<?php

class Form_Decorators extends Ga_Form {

    function __construct($options = array())
    {
        $optionsDefault = array(
            'decorators' => array('FormElements', 'Form')
        );

        parent::__construct(array_merge($optionsDefault, $options));
    }

    public function addDisplayGroup(array $elements, $name, $options = null)
    {
        if (null === $options) {
            $options = array();
        }

        $optionsElement = array(
            'decorators' => array('FormElements', 'Fieldset')
        );

        parent::addDisplayGroup($elements, $name, array_merge($optionsElement, $options));
    }

    protected function _addDisplayGroupActions(array $elements)
    {
        $this->addDisplayGroup($elements, 'actions', array(
            'decorators' => array(
                'FormElements',
                array('HtmlTag', array('tag' => 'div', 'class' => 'form-actions'))
            )
        ));
    }

}